<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('recycle_bins', function (Blueprint $table) {
            $table->id();

            $table->string('table')->default('')->comment('表');

            $table->string('table_id', 39)->default('')->comment('table id');

            $table->json('data')->nullable()->comment('数据');

            $table->timestamp('purge_at')->nullable()->comment('清楚时间');

            $table->timestamps();

            $table->comment('回收站表');

            $table->unique(['table', 'table_id']);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('recycle_bins');
    }
};
